<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<!--通过标签名获取   返回的是数组-->
<div>div01</div>
<div>div02</div>
<div>div03</div>
<div>div04</div>
<div>div05</div>
<div>div06</div>
</body>
</html>
<script type="text/javascript">
    var divForArray=document.getElementsByTagName('div');
    console.log('getElementsByTagName获取到的内容');
    for(var index=0;index<divForArray.length;index++){
        console.log(divForArray[index]);
    }
    console.groupEnd();
</script>